package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * The persistent class for the province database table.
 */
@Entity
@Table(name = "province")
@NamedQueries({
        @NamedQuery(name = "Province.findAll", query = "SELECT p FROM Province p"),
        @NamedQuery(name = "Province.findById", query = "SELECT p FROM Province p WHERE p.id = :id"),
        @NamedQuery(name = "Province.findByProvinceName", query = "SELECT p FROM Province p WHERE p.provinceName = :provinceName")})
public class Province implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    @Column(name = "province_name", nullable = false, length = 255)
    private String provinceName;

    // bi-directional many-to-one association to Employee
    @OneToMany(mappedBy = "province")
    private List<Employee> employees;

    // bi-directional many-to-one association to JobSeeker
    @OneToMany(mappedBy = "province")
    private List<JobSeeker> jobSeekers;

    public Province() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProvinceName() {
        return this.provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public List<Employee> getEmployees() {
        return this.employees;
    }

    public void setEmployees(List<Employee> employees) {
        this.employees = employees;
    }

    public List<JobSeeker> getJobSeekers() {
        return this.jobSeekers;
    }

    public void setJobSeekers(List<JobSeeker> jobSeekers) {
        this.jobSeekers = jobSeekers;
    }

}